home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.2
/
Video Toaster v4.2.iso
/
arexx
/
editor
/
stopframe.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-12-22
|
5KB
|
153 lines
/* StopFrame.rexx V3.0 -- Grabs frames on cue from GPI trigger for stop-motion animation */
/* Originaly by Arnie Cachelin © 1992 NewTek Inc. */
/* 4.0 Version by Bob Caron (Grue) © 1995 NewTek Inc. (REXX LIVES!!!!!!!) */
/*
This program will grab and save frames on cue from the GPI trigger.
If you enter a number to grab, it will save that many then exit.
Otherwise, 3 frames will be saved, then the prog. will exit. Since
the Toaster is waiting for GPI input most of the time, it will not
respond to anything else, which you may find annoying. You can easily
give your Toaster GPI pulses by attaching a spare mouse or joystick to
the second mouse port then clicking the button. You can also find long
joystick extender cables at places like Radio Shack.
To grab frames for a Claymation(TM) of stop-motion style animation, setup your
camera and 'actors', hook up a GPI trigger, and start this script with
appropriate arguments. When your first frame is ready, hit the trigger
to grab and save it. The toaster will then go into an 'onionskin' mode
where the camera is half dissolved over the last frame for ease of
positioning the actors. When you hit the GPI again, the Toaster will leave
onionskin mode and grab the next frame, then return to onionskin mode.
For best results, watch out for stray shadows, or shadows from the sun which
will change over the course of your shoot.
*/
OPTIONS RESULTS
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT' , 0)
call addlib("ToasterARexx.port" , 0)
call set_view(2)
call req_error("StopFrame V3.0 --- Create stop-frame animation as a sequence of image files..")
rx startfilereq("Save Frames Where?","Toaster:Images","StopMotion.")
exit=1
do while exit=1
name=queryfilereq()
if name=0 then call quit
if name~="" then exit=0
address command "c:wait 1"
end
call req_error("Example: 150 frames = 5 seconds.")
count=0
do while(count<1)
count=req_number("Number Of Frames To Grab",100)
if count=0 then call quit()
if count="CANCEL" then call quit()
end
call req_error("")
startframe=0
do while(startframe<1)
startframe=req_number("Starting Frame #",1)
if startframe=0 then call quit()
if startframe="CANCEL" then call quit()
end
vidinput="-1"
buttons='1000'
do while vidinput="-1"
buttons=req_buttons("Choose Input:",buttons,"Main 1","Main 2","Main 3","Main 4")
if buttons="CANCEL" then call quit
if buttons="1000" then do
vidinput="001"
end
if buttons="0100" then do
vidinput="002"
end
if buttons="0010" then do
vidinput="003"
end
if buttons="0001" then do
vidinput="004"
end
end
inputp="P"||vidinput
inputm="M"||vidinput
format=-1
buttons='10'
do while format=-1
buttons=req_buttons("Choose File Format:",buttons,"24Bit IFF","Framestore")
if buttons="CANCEL" then call quit
if buttons="10" then do
format=0
end
if buttons="01" then do
format=1
end
end
if req_tell("Notice!","Make sure your GPI trigger is","connected to the 2nd mouse port.")=0 then call quit
call req_error("Note: Once you begin this process you can't abort without rebooting your machine.")
if req_tell("Click 'Continue' to begin.")=0 then call quit
Switcher(TOSW) /* Go to Switcher screen */
Switcher(inputp)
Switcher(inputm)
Switcher(LVID)
Switcher(PDV1)
Switcher(inputp)
i=startframe
call req_open("Hit GPI trigger to grab current frame.")
call req_error("StopMotion: Current Frame ("||i||") Frames to go ("||((startframe+count)-1)-i||")")
Do i=startframe to (startframe+count)
Switcher(FVID) /* Freeze frame */
Frame=right(trim(i),3,"0")
Fname=strip(name)||right(i,3,'0')
if format=0 then
t=switcher(SRGB,fname,0,5)
else
t=switcher(FMSV,fname,4)
call req_close()
call req_open("Hit GPI trigger to grab current frame.")
Switcher(inputp)
Switcher(MDV1)
Switcher(TBAR,255)
call req_error("StopMotion: Current Frame ("||i||") Frames to go ("||(startframe+count)-i||")")
if i=(startframe+count) then break
Switcher(WAIT,GPI) /* Wait for GPI trigger to come in */
Switcher(TAKE)
Switcher(LVID) /* Set to live digital video */
Switcher(PDV1)
Switcher(inputp)
Switcher(FRES)
Switcher(WAIT,60)
end
call req_close()
call req_error("")
call req_error("All done.")
quit:
call req_close()
call req_error("Canceled.")
call remlib('PROJECT_REXX_PORT')
call remlib('ToasterARexx.port')
exit